package controllers

import (
	"GameApiServer/game"
	beego "github.com/beego/beego/v2/server/web"
)

type MainController struct {
	beego.Controller
}

func (c *MainController) Get() {
	//c.Data["Website"] = "beego.me"
	//c.Data["Email"] = "astaxie@gmail.com"
	//c.TplName = "index.tpl"
	api := "master"
	dataMsg := []interface{}{1}
	mKey := "K"
	sid := "1"
	fMsg := game.FormatMessage(api, dataMsg, mKey, sid)
	if fMsg != nil {
		ok, _ := game.RequestGameServer(fMsg)
		if ok {
			c.Ctx.Output.Body([]byte("OK"))
		}
	}
	c.Ctx.Output.Body([]byte("Error"))
}
